package com.xinhua.erp.repo;

import com.xinhua.erp.pojo.Retail;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface RetailRepo extends JpaRepository<Retail,Long> , JpaSpecificationExecutor<Retail> {
    Page<Retail> findAllByType(String type, Pageable pageable);


    @Modifying
    @Query(value = "update retail set status='已审核' where id =?",nativeQuery = true)
    void updateStatus(Long id);
}
